import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import axios from "axios";
import VueAxios from "vue-axios";
import "element-plus/dist/index.css";
import "nprogress/nprogress.css"; //引用进度样式
require("@/util/data");

const app = createApp(App);
app.use(store);
app.use(VueAxios, axios);
app.use(router);
//权限控制
app.directive("permission", {
  mounted(el, binding) {
    let val = binding.value;
    console.log(val);
    let perms = store.state.addusermodules.user || [];
    if (!perms.find((item) => item == val)) {
      el.remove();
    }
  },
});
app.mount("#app");
